﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Web.DynamicData;

public partial class _Default : System.Web.UI.Page {
    //public string ResolveURL()
    //{
    //    return "http://" + Request.Url.Host + ":" + Request.Url.Port + Request.Url.Segments[0].ToString().Replace("//", "/") + Request.Url.Segments[1].ToString().Replace("//", "/");
    //}

    protected void Page_Load(object sender, EventArgs e) {

        System.Collections.IList visibleTables = ASP.global_asax.DefaultModel.VisibleTables;
        if (visibleTables.Count == 0) {
            throw new InvalidOperationException("There are no accessible tables. Make sure that at least one data model is registered in Global.asax and scaffolding is enabled or implement custom pages.");
        }
        Menu1.DataSource = visibleTables;
        Menu1.DataBind();
    }

}
